﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Mvc;

// For more information on enabling Web API for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860

namespace Api.Controllers
{
    [Route("api/[controller]")]
    public class MemberController : Controller
    {
        /// <summary>
        /// 用户登录
        /// </summary>
        /// <param name="account">账号</param>
        /// <param name="pwd">密码</param>
        /// <returns></returns>
        [HttpGet("login")]
        public ActionResult<CommonApiResult<EntityCore.Member.MemberInfo>> Login(string account, string pwd)
        {
            return Json(ApiResultUtils.Success(new Manage.Member.MemberMange().MemberLogin(account, pwd), "登录成功"));
        }


        /// <summary>
        /// 用户注册
        /// </summary>
        /// <param name="account">账号</param>
        /// <param name="pwd">密码</param>
        /// <param name="avatar">头像</param>
        /// <param name="nickName">昵称</param>
        /// <returns></returns>
        [HttpPost("register")]
        public ActionResult<CommonApiResult> Register(string account, string pwd, string avatar, string nickName)
        {
            return Json(ApiResultUtils.Success("注册成功,请牢记您的密码"));
        }



    }
}
